<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // arguments是函数内部内置的伪数组，它包含了调用函数时传入的所有实参
    function getSum() {
      // arguments 动态参数  只存在于 函数里面
      // 1.是伪数组
      // console.log(arguments)
      let sum = 0
      for (let i = 0; i < arguments.length; i++) {
        sum += arguments[i]
      }
      console.log(sum)
    }
    getSum(2, 3)
    getSum(2, 3, 4)
    getSum(2, 3, 4, 5, 6, 7)
  </script>
</body>

</html>